<?php
/**
 * Base model object, loosely applying the active record pattern.
 * 
 * @package Bedrock
 * @author Nick Williams
 * @version 1.0.0
 * @created 07/09/2008
 * @updated 07/09/2008
 */
abstract class Bedrock_Model extends Bedrock {
	protected $_database;
	protected $_connection;
	
	/**
	 * Initializes the object.
	 * 
	 * @param $database the database object to use
	 */
	public function __construct($database = NULL) {
		if($database) {
			$this->_database = $database;
		}
		else {
			$this->_database = Bedrock_Common_Registry::get('database');
		}
		
		$this->_connection = $this->_database->getConnection();
		
		parent::__construct();
	}
}
?>